<%= form_for @changeset, @action, fn f -> %>
  <%= if @changeset.action do %>
    <div class="alert alert-danger">
      <p>Oops, something went wrong! Please check the errors below.</p>
    </div>
  <% end %>

  <div class="form-group">
    <%= label f, :title %>
    <%= text_input f, :title, class: ["form-control"] %>
    <%= error_tag f, :title %>
  </div>

  <div class="form-group">
    <%= label f, :slug %>
    <%= text_input f, :slug, class: ["form-control"] %>
    <%= error_tag f, :slug %>
  </div>

  <div class="form-group">
    <%= label f, :description %>
    <%= text_input f, :description, class: ["form-control"] %>
    <%= error_tag f, :description %>
  </div>

  <div class="form-group">
    <%= label f, :body_md %>
    <%= textarea f, :body_md, class: ["form-control"], rows: "10" %>
    <%= error_tag f, :body_md %>
  </div>

  <div class="custom-control custom-checkbox mb-4">
    <%= checkbox f, :published, class: ["custom-control-input"] %>
    <%= label f, :published, class: ["custom-control-label"] %>
    <%= error_tag f, :published %>
  </div>

  <%= submit "Save", class: "btn btn-primary" %>
<% end %>
